import React from 'react'
import { Button } from 'antd-mobile'
import '../style/Delivery_address.css'
import Address_book from './Address_book'
import { useNavigate } from 'react-router-dom'

import { NavBar } from 'antd-mobile'
export default React.memo( function Delivery_address() {

    const navigate = useNavigate()
    const handleAdd = () => {
        navigate('/add_address')
    }
    const back = () => {
        window.history.back()
        sessionStorage.setItem('integralShop', JSON.stringify({ flag: true }))
    }


    return (
        <div className='Delivery_address'>
            <NavBar onBack={back}>
                收货地址
            </NavBar>
            <Address_book />
            <Button color='danger' className='btn' onClick={handleAdd}>+ 新增地址</Button>
        </div>
    )
})
